<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>教务管理系统管理课程</title>
    <link rel="stylesheet" href="../css/homePage.css"/>
    <link rel="stylesheet" href="../css/homePageManageCourse.css"/>
    <script src="../js/public.js"></script>
</head>
<body>
<div id="div">
    <div id="page_left">
        <div id=page_left_fonts>
            <span onclick="sy()">首&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;页</span>
        </div>
    </div>
    <div id="Page_right">
        <div id="Page_right_manageCourse_top">
            <div id="Page_right_manageCourse_top_addCourse">
                <button id="Page_right_manageCourse_top_addCourse_btn" onclick=addCourse()>添加课程</button>
            </div>
            <div id="Page_right_manageCourse_top_mark">
                <div id=Page_right_manageCourse_top_mark_select0>
                    <button id="Page_right_manageCourse_top_mark_markOfId_btn" onclick=markOfId()>查询该学生选择的课程</button>
                    <input id="Page_right_manageCourse_top_mark_markOfId_input" type="text">
                </div>
                <div id=Page_right_manageCourse_top_mark_select1>
                    <button id="Page_right_manageCourse_top_mark_markOfCourseId_btn" onclick=markOfCourseId()>查询选择该课程的学生</button>
                    <input id="Page_right_manageCourse_top_mark_markOfCourseId_input" type="text">
                </div>
            </div>
        </div>
        <div id="Page_right_manageCourse_bottom">

        </div>
    </div>
</div>
</body>
</html>

<script src="../js/axios.js"></script>
<script>
    window.onload = function () {
        document.getElementById("div").style.height = window.screen.availHeight - 120 + "px";

        //添加数据(一级优先)
        axios.post("http://localhost:8080/JWGLSystem/homePageServlet").then(function (resp) {
            users = resp.data;
            if (users.userName == undefined) {
                window.location.href = "../index.html";
            }

            //实现左侧菜单栏
            if (users.userPost == "管理") {
                document.getElementById("page_left_fonts").innerHTML +=
                    "            <span id='selectCourse' onclick = 'kccx()'>课程查询</span>\n" +
                    "            <span id='selectScore' onclick = 'cjcx()'>成绩查询</span>\n" +
                    "            <span id='addCourse' onclick = 'kcgl()'>课程管理</span>\n" +
                    "            <span id='adTeachers' onclick = 'gljs()'>管理教师</span>\n" +
                    "            <span id='adStudents' onclick = 'glxs()'>管理学生</span>\n" +
                    "            <span id='addAnn' onclick='ggfb()'>发布公告</span>\n" +
                    "            <span id='selectAnn' onclick='ggcx()'>公告查询</span>"
            } else if (users.userPost == "学生") {
                document.getElementById("page_left_fonts").innerHTML +=
                    "            <span id='selectCourse' onclick='kccx()'>课程查询</span>\n" +
                    "            <span id='selectScore'  onclick = 'cjcx()'>成绩查询</span>\n" +
                    "            <span id='selectAnn' onclick='ggcx()'>公告查询</span>"
            } else if (users.userPost == "老师") {
                document.getElementById("page_left_fonts").innerHTML +=
                    "            <span id='selectCourse' onclick='kccx()'>课程查询</span>\n" +
                    "            <span id='selectScore'  onclick = 'cjcx()'>成绩查询</span>\n" +
                    "            <span id='addCourse' onclick = 'kcgl()'>课程管理</span>\n" +
                    "            <span id='adStudents' onclick = 'glxs()'>管理学生</span>\n" +
                    "            <span id='addAnn' onclick='ggfb()'>发布公告</span>\n" +
                    "            <span id='selectAnn' onclick='ggcx()'>公告查询</span>"
            }
        });
    }
</script>